<template>
    <div>
        <slot name="setting"></slot>
        <blank-place-holder v-if="item.data.images.length === 0" msg="请在右侧添加至少一张图片"></blank-place-holder>
        <van-swipe :style="{
            height: item.data.images.length === 0 ? '204px' : 'auto'
        }" class="my-swipe" :autoplay="3000" indicator-color="white">
            <van-swipe-item :style="{
                    backgroundSize: 'cover',
                    backgroundRepeat: 'no-repeat',
                    backgroundPosition: 'center',
                    backgroundImage: 'url(' + row.url + ')'
        }" v-for="(row, index) in item.data.images" :key="index">
            </van-swipe-item>
        </van-swipe>
    </div>
</template>
<script>
    import BlankPlaceHolder from "../../BlankPlaceHolder";

    export default {
        components:{
            BlankPlaceHolder
        },
        props: {
            item: Object
        },
        data() {
            return {

            };
        },
        methods: {
            length() {
                return this.item.data.images.length
            },
        },
    };
</script>
<style scoped>
    .my-swipe .van-swipe-item {
        color: #fff;
        font-size: 20px;
        height: 150px;
        text-align: center;
        background-color: #39a9ed;
    }
</style>